package map;

import java.util.HashMap;
import java.util.Map;

public class MapDemo1 {
    public static void main(String[] args) {
        Map<String, Integer> map = new HashMap<>();
        Integer v = map.put("语文", 99);

        System.out.println(v);

        map.put("数学", 99);
        map.put("英语", 98);
        map.put("物理", 97);
        map.put("化学", 96);
        System.out.println(map);

        v = map.put("语文",1);
        System.out.println(map);
        System.out.println(v);

        v = map.get("数学");
        System.out.println("数学:"+v);
        v = map.get("体育");
        System.out.println("体育:"+v);

        v = map.remove("化学");
        System.out.println(map);
        System.out.println(v);

        System.out.println("size:"+map.size());
        boolean ck = map.containsKey("语文");
        System.out.println("包括key:"+ck);
        boolean cv = map.containsKey(55);
        System.out.println("包含value:"+cv);
    }
}
